﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminIndexMaster.master" AutoEventWireup="true" CodeFile="Admin_Lable.aspx.cs" Inherits="Admin_Admin_Lable" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
    function runCode(id) {
        var obj = document.getElementById(id);
        var winname = window.open('', "_blank", '');
        winname.document.open('text/html', 'replace');
        winname.opener = null             // 防止代码对页面修改
        winname.document.write(obj.value);
        winname.document.close();
    }
    function SelectAll(x) {
        var obj = document.all(x);
        for (var i = 0; i < obj.length; i++) {
            obj[i].checked = !(obj[i].checked);
        }
    }
</script>
   <table class="adminheading">
         <tr>
            <th class="templates">标签管理</th>                  
            <td align="right">
            <div style="width:100px"><a href="Admin_AddLabel.aspx">添加标签</a></div></td> 
            <td class="rtdw"></td>
         </tr>
   </table>
   
   <table class="nick" cellpadding="1" cellspacing="1">
        <tr><td class="tit" colspan="3">标签管理</td></tr>
        <tr><td class="ltd" style="text-align:center"><a href="Admin_Lable.aspx">显示全部</a></td><td class="rtd"><asp:Literal ID="LableManage" runat="server" /></td>
            <td align="right"><asp:TextBox ID="Txtkeyword" runat="server"/><asp:Button ID="Sreach" runat="server" Text=" 搜 索 " OnClick="Sreach_OnClick" /></td></tr>
   </table>
    <asp:GridView ID="GridView1" DataKeyNames="ID" runat="server" AllowPaging="True" AutoGenerateColumns="False"  
      CssClass="adminlist"  PageSize="15" OnDataBound="GridView1_DataBound" OnPageIndexChanging="GridView1_PageIndexChanging">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate><a href="javascript:{SelectAll('IDs');}">编号</a></HeaderTemplate>
                <ItemTemplate>
                    <input value="<%# Eval("ID") %>" name="IDs" id="IDs" type="checkbox" />
                </ItemTemplate>
                <HeaderStyle Width="5%" />
            </asp:TemplateField>                                  
            <asp:BoundField DataField="Name" HeaderText="名称">
                <HeaderStyle Width="45%" />
            </asp:BoundField>
            <asp:BoundField DataField="Type" HeaderText="分类">
                <HeaderStyle Width="10%" />
            </asp:BoundField>
            <asp:BoundField DataField="UpdateTime" HeaderText="更新时间"  >
                <HeaderStyle Width="15%" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="操作" >              
               <ItemTemplate >
                  <a href="Admin_AddLabel.aspx?action=modify&id=<%# Eval("ID") %>">修改</a> |
                  <asp:LinkButton ID="DeleteButton" runat="server" OnCommand="Delete_Click" CommandArgument='<%# Eval("ID") %>' Text="删除" OnClientClick="return confirm('是否删除本标签？')" />  | 
                  <asp:LinkButton ID="CopyButton" runat="server"  Text="复制"  CommandName='<%# Eval("ID") %>' OnClientClick="return confirm('是否复制？')" OnCommand="CopyButton_OnCommodn" /> |
                  <asp:LinkButton ID="butcon" CommandName='<%# Eval("Name") %>' CommandArgument='<%# Eval("ID") %>' Text="内容" runat="server" OnCommand="GoConetent" /> 
                  <a href="Admin_Lable.aspx?action=updateLabel&id=<%# Eval("ID") %>"  <%# (Eval("OutPutType").ToString()!="static"?"style=\"display:none;\"":Eval("OutPutType") ) %>  > | 更新静态</a>
               </ItemTemplate>
                <HeaderStyle Width="20%" />
            </asp:TemplateField>
        </Columns>          
    </asp:GridView>
    
    <div class="div_btm">
        <asp:Button ID="DeleteALL" runat="server" Text= "批量删除" OnClick="DeleteALL_OnClick" OnClientClick="return confirm('确定删除选定项吗？')" />
        <input onclick="javascript:{location.href='Admin_LabelIO.aspx';return false;}" type="button" value="导入导出" />
    </div>

</asp:Content>

